export class ApiUri {
    public readonly API = "api/";

    public readonly Project = {
        ROOT: this.API + 'project/',
        LIST: this.API + 'project/list',
        COMPONENTS: this.API + 'project/components/',
        RELEASED: this.API + 'project/released/',
        COPY_PROJECT: this.API + 'project/copy-project/',
    };

    public readonly Flow = {
        ROOT: this.API + 'flow/',
        LIST: this.API + 'flow/list',
        // ADD_NODE: this.API + 'flow/add-node',
        ALL_FLOW_NODE_DETAIL: this.API + 'flow/all-flow-node-detail',
        UPDATE_FLOW: this.API + 'flow/update-flow',
        UPDATE_NODE: this.API + 'flow/update-node',
        RUN: this.API + 'flow/run/',
        STOP: this.API + 'flow/stop/',
    };

    public readonly System = {
        ROOT: this.API + 'system/',
        CONFIG: this.API + 'system/config',
        OPEN_FILE: this.API + 'system/open-file',
        OPEN_FORM: this.API + 'system/open-form/',
        GLOBAL_PARAM: this.API + 'system/global-param',
    };

    public readonly GlobalParam = {
        ROOT: this.API + 'global-param/',
        BATCH_UPDATE: this.API + 'global-param/batch',
    };

    public readonly Device = {
        ROOT: this.API + 'device/',
        LIST: this.API + 'device/list',
        GET_PLC_ADDRESS: this.API + 'device/plc/address/',
        GET_PLC_ADDRESS_BY: this.API + 'device/plc/address-by/',
        GET_PLC_ADDRESS_SAVE: this.API + 'device/plc/address/save',
        GET_PLC_ADDRESS_ID: this.API + 'device/plc/address/id/',
        SYNCHRONIZATION_DATA: this.API + 'device/plc/synchronization-data/',
        SEND_MESSAGE: this.API + 'device/socket/send-message/',
        SOCKET_CLIENTS: this.API + 'device/socket/clients/{ServerId}',
    };

    public readonly UserComponent = {
        ROOT: this.API + 'user-component/',
        LIST: this.API + 'user-component/list',
    };

    public readonly Node = {
        ROOT: this.API + 'node/',
        LIST: this.API + 'node/list',
        HUB: this.API + 'node/list/hub',
        UPDATE_NODE_PARAM: this.API + 'node/update-node-param',
        CONNECTION: this.API + 'node/connection',
        SAVE_NODE_MES_CONFIG: this.API + 'node/save-node-mes-config',
        NODE_CONFIG: this.API + 'node/node-config',
        // DELETE_NODE: this.API + 'node/delete-node',
    };

    public readonly Event = {
        ROOT: this.API + 'event/',
        LIST: this.API + 'event/list',
    };

    public readonly DataManage = {
        ROOT: this.API + 'data-manage/',
        TABLE_NAME: this.API + 'data-manage/table-name',
        TABLE_STRUCTURE: this.API + 'data-manage/table-structure',
        QUERY_BY_SQL: this.API + 'data-manage/query-by-sql',
        PAGE_QUERY_BY_SQL: this.API + 'data-manage/page-query-by-sql',
        EXECUTE_SQL: this.API + 'data-manage/execute-sql',
        LIST: this.API + 'data-manage/list',
    };
}

export interface HttpResultType<T = object> {
    Code: number,
    IsSuccess: boolean,
    Data: T,
    Message: string
}
